package com.cskaoyan.controller.admin.stat;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.admin.stat.AdminStatVo;
import com.cskaoyan.service.admin.state.AdminStatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author MoJunXiang
 * @since 2022/09/07 17:36
 */
@RestController
@RequestMapping("admin/stat")
public class AdminStatController {
    @Autowired
    AdminStatService adminStatService;

    @RequestMapping("user")
    public BaseRespVo<AdminStatVo> user() {
        AdminStatVo stateVo = adminStatService.user();

        // 返回值
        BaseRespVo<AdminStatVo> vo = new BaseRespVo<>();
        vo.setErrno(0);
        vo.setErrmsg("成功");
        vo.setData(stateVo);

        return vo;
    }


    @RequestMapping("order")
    public BaseRespVo<AdminStatVo> order() {
        AdminStatVo statVo = adminStatService.order();

        // 返回值
        BaseRespVo<AdminStatVo> vo = new BaseRespVo<>();
        vo.setErrno(0);
        vo.setErrmsg("成功");
        vo.setData(statVo);

        return vo;
    }


    @RequestMapping("goods")
    public BaseRespVo<AdminStatVo> goods() {
        AdminStatVo statVo = adminStatService.goods();

        // 返回值
        BaseRespVo<AdminStatVo> vo = new BaseRespVo<>();
        vo.setErrno(0);
        vo.setErrmsg("成功");
        vo.setData(statVo);

        return vo;
    }


}
